<template>
<!-- vue过渡 -->
    <div>
        <button @click="isShow = !isShow">显示/隐藏</button>
        
        <transition-group appear name="sanpi">
            <h1 :key="1" v-show="!isShow" >{{msg}}</h1>
            <h1 :key="2" v-show="isShow" >{{msgs}}</h1>
        </transition-group>
    </div>
</template>
<script>
export default {
    data() {
        return {
            msg:'杨三皮',
            msgs:'杨四皮',
            isShow:true,
        }
    },

}
</script>
<style >
    h1{
        background-color: aqua;
        
    }

    /* 进入的起点  离开的终点*/
    .sanpi-enter,.sanpi-leave-to{
        transform: translateX(-100%);
    }

    /* 进入的过程   离开的过程 */
    .sanpi-enter-active,.sanpi-leave-active{
        transition: 1s linear ;
    }

    /* 进入的终点 离开的起点*/
    .sanpi-enter-to,.sanpi-leave{
        transform: translateX(0);
    }




</style>